== Description of C64 BASIC Code for VC3 2021 Christmas tree program ==

The widths of the Christmas tree are 1,3,5,7,3,7,11,15,5,11,17,23,3,3. While a nested loop can calculate the first 12 numbers, I found it shorter to store the numbers in a DATA statement. Since all numbers are uneven, storing halved numbers is sufficient to reconstruct the original width. This makes it also easier to calculate the necessary indentation. We can save further on length by decreasing all numbers until we have a maximum of zeroes since a 0 can be encoded by just a comma in a data statement. The reduction is accounted by the argument in the command SPC(20-w) which becomes SPC(18-w) for numbers reduced previously by 2. In addition, the loop for printing the stars has to be adjusted to start with -2.

The program is a oneliner that can be entered on the native system, but it is necessary to abbreviate the commands when entering them. Note that the abbreviation of SPC includes the (. The program loops with a GOTO command at the end. On the C64, a GOTO without a number jumps to line 0. The program ends with a glorious OUT OF DATA ERROR when it runs out of data. 

The program also works on Commdore PET, Commodore C16 and Commdore Plus/4. The submitted version does not work on a C128 because it is necessary to specify the GOTO target, so a 0 has to be added at the end of the line.

Abbreviated line (for entering):

0dA-1,,1,2,,2,4,6,1,4,7,10,,:rEw:?sP18-w);:fOk=-2tow+w:?"*";:nE:?:gO

Expanded code (cannot be edited anymore because it exceeds 2 lines):

0 data-1,,1,2,,2,4,6,1,4,7,10,,:readw:printspc(18-w);:fork=-2tow+w:print"*";:next:print:goto
